const defaultState = {
    columns: [],
    visible: false
};
export default function columns(state = defaultState, action) {
    const {type, payload} = action;
    switch (type) {
        case 'GH_ORDER.GET_COLUMNS':
            return {...state, columns: [...payload]};
        case 'GH_ORDER.HIDE_COLUMNS':
            return {...state, visible: false, columns: []};
        case 'GH_ORDER.SHOW_COLUMNS':
            return {...state, visible: true};
        default:
            return state;
    }
}

